import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.masc.gurr.model.Group;
import com.masc.gurr.model.Message;
import com.masc.gurr.model.ProtocolType;
import com.masc.gurr.model.SessionInfo;
import com.masc.gurr.model.xml.Reader;
import com.masc.gurr.model.xml.Writer;


public class xmlTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("reading contact list");
		Reader reader = new Reader();
		Writer writer = new Writer();
		Group g = reader.readContactList("638665321", ProtocolType.ICQ);
		SessionInfo s = reader.readInfo("638665321", ProtocolType.ICQ);
		writer.writeContactList("638665321", ProtocolType.ICQ, g);
		writer.writeInfo(s);
		
		List<Message> msgs = reader.readHistory("638665321", "123", ProtocolType.ICQ, -1, 0);
		Iterator<Message> it = msgs.iterator();
		while (it.hasNext()) {
			Message message = (Message) it.next();
			System.out.println(":" + message.getContent());
		}
	}

}
